package com.zhuangjie.shop.constant;

public class ShoppingCartConstant {

    public static final String SHOPPING_CART_CACHE_KEY_PREFIX = "shoppingCart::";
    // 6个小时后过期
    public static final Integer TTL_IN_SECONDS = 60 * 60 * 6;

    public static String buildShoppingCartKey(Object shopId,Object userId) {
        if (shopId == null || userId == null) {
            throw new RuntimeException("无法构建购物车KEY！");
        }
        return SHOPPING_CART_CACHE_KEY_PREFIX+shopId+"::"+userId;
    }


}
